package net.mymilkedeek.ludum.tinythumb.model;

import org.newdawn.slick.util.Log;

/**
 * TODO: Write Documentation
 *
 * @author Michael Demey
 */
public class PartyFactory {

    Party[] parties = new Party[]{
            new Party(new Member("Tor", 20, 20, 10), new Member("Tor", 20, 20, 10))
    };
    static Party gnome = new Party(new Member("gnome", 100, 20, 20), null);
    static Party foot = new Party(new Member("foot", 300, 30, 30), null);

    public static boolean footB;
    private int count = 0;

    public Party letsGetThisPartyStarted() {
        reInitialize();
        Log.debug("pF " + gnomeB);
        if (!gnomeB && !footB) {
            Log.debug("partyfactory " + count + "/" + parties.length);
            if (count == parties.length) {
                count = 0;
            }

            Party party = parties[count];

            count++;

            return party;
        } else {
            if ( gnomeB ) {
                return gnome;
            } else {
                return foot;
            }
        }
    }

    private void reInitialize() {
        parties = new Party[]{
                new Party(new Member("Tor", 20, 20, 10), new Member("Tor", 20, 20, 10))
        };
    }

    public static boolean gnomeB = false;

    public static Party gnomeUp() {
        gnomeB = true;
        return gnome;
    }
    
    public static Party foot() {
        footB = true;
        return foot;
    }
}